<#assign contextPath=rc.contextPath/> <#include
"/common/__context.html"/> <#assign pageTitle="VIGOR"/> <#assign
pageBreadCrumbs>
<li class="active"><a href="#"
	onclick="loadContext('${contextPath}/user');">用户列表</a></li>
<li class="active">编辑用户</li>
</#assign> <#assign currentMenu="menu20-menu2"/>
<script src="${contextPath}/static/js/select2.js"></script>
<script type="text/javascript">
	jQuery(function($) {
		$('.select2').css('width', '300px').select2({
			allowClear : true
		})

		$('#saveBtn').click(function() {
			$('#editUserForm').submit();
		});
	});
</script>
<@mainContext pageTitle=pageTitle pageBreadCrumbs=pageBreadCrumbs
currentMenu=currentMenu>
<!-- pageContent BEGAIN-->
<div class="row">
	<div class="col-xs-12">
		<!-- PAGE CONTENT BEGINS -->
		<form id="editUserForm" class="form-horizontal" role="form"
			target="formIFrame" method="post" action="${contextPath}/user/update">

			<input type="hidden" name="uid" value="${user.uid}"/>
			
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="username"> 用户名 </label>

				<div class="col-sm-9">
					<input type="text" id="username" name="username" value="${user.username}"
						placeholder="请输入用户名" class="col-xs-10 col-sm-5" />
				</div>
			</div>
			
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="username"> 角色列表 </label>

				<div class="col-sm-9">
					<input readonly type="text" id="" name="" value="${user.roledesc}"
						placeholder="" class="col-xs-10 col-sm-5" />
				</div>
			</div>

			<div class="form-group">
				<label class="control-label col-xs-12 col-sm-3 no-padding-right">
					选择角色 </label>

				<div class="col-sm-9">
					<select multiple="" id="roleselect" name="roles" class="select2"
						data-placeholder="选择角色...">
						<option value="">&nbsp;</option> <#list roles as role>
						<option value="${role.rid}">${role.description}</option> </#list>
					</select>
				</div>
			</div>

			<div class="hr hr-16 hr-dotted"></div>

			<div class="col-md-offset-3 col-md-9">
				<button class="btn btn-sm btn-success" id="saveBtn" type="button">
					<i class="ace-icon fa fa-check bigger-110"></i> 保存
				</button>

				&nbsp; &nbsp; &nbsp;
				<button class="btn btn-sm" type="reset">
					<i class="ace-icon fa fa-undo bigger-110"></i> 重置
				</button>
			</div>

		</form>
		<!-- PAGE CONTENT ENDS -->

		<iframe name="formIFrame" style="display: none;"></iframe>

	</div>
	<!-- /.col -->
</div>
<!-- pageContent END -->
</@mainContext>
